<template>
	<div>
		<el-table :data="userList" stripe>
	    <el-table-column prop="username" label="姓名"width="180">
	    </el-table-column>
	    <el-table-column prop="email" label="邮箱" width="180">
	    </el-table-column>
	    <el-table-column prop="mobile" label="电话">
	    </el-table-column>
	    <el-table-column prop="mg_state" label="用户状态">
	    </el-table-column>
	    <el-table-column prop="address" label="操作">
	    </el-table-column>
	  </el-table>
		
	</div>
</template>

<script>
//import axios from 'axios'
	export default{
		created(){
//			console.log(this.$http===axios)
			this.getUserList()
		},
		
	  data() {
      return {
        userList: []
      }
    },
    methods:{
    	//获取用户列表数据
    	getUserList(){
    		this.$http.get('/users',{
    			params:{
    				//取单一也数据
    				pagenum:1,
    				pagesize:3
    			}
//  			,
//  			headers:{
//  				Authorization: localStorage.getItem('token')
//  			}
    			}).then(res=>{
//  				console.log(res)
console.log("请求成功")
						const {data,meta}=res.data
						if(meta.status===200){
							this.userList=data.users
						}
    			})
    	}
    }
    
	}
</script>

<style>
</style>